package com.kaiyiweitong.tongxing.base;

/**
 * Created by Administrator on 2017/12/15 0015.
 */

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.kaiyiweitong.tongxing.R;

import butterknife.ButterKnife;


/**
 * Created by Administrator on 2017/12/2 0002.
 */

public class BaseActivity extends AppCompatActivity implements View.OnClickListener{

    private View mBack;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        ButterKnife.bind(this);
        mBack = findViewById(R.id.back);
        if (mBack != null) {
            mBack.setOnClickListener(this);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(BaseActivity.this);
    }

    @Override
    public void onClick(View view) {
        if (view == mBack) {
            finish();
        }
    }
}
